﻿{template 'header', $module}
<script type="text/javascript">c(2);</script>
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="action_buy"><a href="credit.php?action=buy"><span>{$DT[credit_name]}Buy</span></a></td>
<td class="tab_nav">&nbsp;</td>
{if $MOD[credit_exchange]}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_exchange"><a href="credit.php?action=exchange"><span>{$DT[credit_name]}Exchange</span></a></td>
{/if}
<td class="tab" id="action"><a href="credit.php"><span>{$DT[credit_name]}Record</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_invite"><a href="credit.php?action=invite"><span>Earn promotion{$DT[credit_name]}</span></a></td>
{if $action == 'less'}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="action_less"><a href="credit.php?action=less"><span>{$DT[credit_name]}imperfect</span></a></td>
{/if}
</tr>
</table>
</div>
{if $action == 'exchange'}
<form method="post" action="credit.php" onsubmit="return check();" id="dform">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="submit" value="1"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">Available{$MOD[ex_name]}</td>
<td class="tr"><strong class="f_blue">{$num}</strong></td>
</tr>
<tr>
<td class="tl">Conversion Ratio</td>
<td class="tr"><span class="f_blue">1</span> {$MOD[ex_name]} Exchange <span class="f_red">{$MOD[ex_rate]}</span> {$DT[credit_name]}</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> Conversion facility</td>
<td class="tr"><input type="text" size="8`" name="amount"/> <span id="damount" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" value=" Determined " class="btn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">
function check() {
	m = parseInt(Dd('amount').value);
	n = {$num};
	if(m > 0 && m < n) {
		return confirm('Sure you want to exchange'+m+'{$MOD[ex_name]}Do? In exchange'+(m*{$MOD[ex_rate]})+'{$DT[credit_name]}\n\nNote: conversion{$MOD[ex_name]}May decrease your membership level in the forum');
	} else {
		Dd('amount').value = '';
		Dmsg('Please fill out the exchange amount', 'amount');
		return false;
	}
}
</script>
<script type="text/javascript">s('credit');m('action_exchange');</script>
{elseif $action == 'buy'}
<form method="post" action="credit.php" onsubmit="return check();" id="dform">
<input type="hidden" name="action" value="{$action}"/>
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">Account balance available</td>
<td class="tr"><strong class="f_blue">{$_money}</strong> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> Buy credit</td>
<td class="tr c_p">
<table cellpadding="5" cellspacing="3">
<tr align="center">
<td>Selected</td>
<td>&nbsp;&nbsp;{$DT[credit_name]}({$DT[credit_unit]})&nbsp;&nbsp;</td>
<td>&nbsp;&nbsp;{$DT[money_name]}({$DT[money_unit]})&nbsp;&nbsp;</td>
</tr>
{loop $C $k $v}
<tr align="center" onclick="Dd('type_{$k}').checked=true;">
<td><input type="radio" name="type" id="type_{$k}" value="{$k}" {if $k==0}checked{/if}/></td>
<td class="f_red">&nbsp;&nbsp;{$v}&nbsp;&nbsp;</td>
<td class="f_blue">&nbsp;&nbsp;{$P[$k]}&nbsp;&nbsp;</td>
</tr>
{/loop}
</table>
</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> Payment password</td>
<td class="tr">{template 'password', 'chip'}&nbsp;<span id="dpassword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" Determined " class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" Reset " class="btn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">
function check() {
	if(Dd('password').value == '') {
		Dmsg('Please fill out the payment password', 'password');
		return false;
	}
}
</script>
<script type="text/javascript">s('credit');m('action_buy');</script>
{elseif $action == 'invite'}
<table cellspacing="1" cellpadding="6" class="tb">
<tr>
<td class="tl">Guide to</td>
<td class="tr">
<input type="radio" name="goto" value="1" id="goto_1" onclick="Dd('codes').value='{$url}';" checked/><label for="goto_1"> Home</label>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="goto" value="2" id="goto_2" onclick="Dd('codes').value='{$url}&goto=register';"/><label for="goto_2"> Sign Up</label>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="goto" value="3" id="goto_3" onclick="Dd('codes').value='{$url}&goto=homepage';"/><label for="goto_3"> My Home</label>
</td>
</tr>
<tr>
<td class="tl">Website Promotion</td>
<td class="tr"><input type="text" name="code" value="{$url}" size="80" id="codes" onmouseover="this.select();" style="padding:3px;"/></td>
</tr>
<tr>
<td class="tl">Promotion methods</td>
<td class="tr">
- The above URL will be sent to you QQ / MSN / Email and other friends<br/>
- In the forum signature, blog links, websites, etc. URL above<br/>
</td>
</tr>
<tr>
<td class="tl">Reward Method</td>
<td class="tr">
- Each guide you can get an IP access <strong class="f_blue">{$MOD[credit_ip]}</strong> {$DT[credit_name]} (Up to accumulate within 24 hours{$MOD[credit_maxip]}{$DT[credit_name]})<br/>
- Each guide a user registration you will receive a <strong class="f_blue">{$MOD[credit_user]}</strong> {$DT[credit_name]}<br/>
</td>
</tr>
<tr>
<td class="tl">Remarks</td>
<td class="tr">
- Whether guided to that page, the system will automatically record your user registration Recommended<br/>
- Guide users need to improve the data only after successful registration you extra points<br/>
- Same IP 24 hours counted once<br/>
</td>
</tr>
<tr>
<td class="tl">Promotion Record</td>
<td class="tr"><a href="credit.php?kw={urlencode('Spread')}" class="t">Click to view&raquo;</a></td>
</tr>
</table>
<script type="text/javascript">s('credit');m('action_invite');</script>
{else}
<form action="?">
<div class="tt">
{$fields_select}&nbsp;
<input type="text" size="30" name="kw" value="{$kw}" title="Keyword"/>&nbsp;
<select name="type">
<option value="0">Type</option>
<option value="1" {if $type==1}selected{/if}>Income</option>
<option value="2" {if $type==2}selected{/if}>Expenditure</option>
</select>
&nbsp;
{dcalendar('fromtime', $fromtime)} To {dcalendar('totime', $totime)}
&nbsp;
<input type="submit" value=" Search " class="btn"/>&nbsp;
<input type="button" value=" Reset " class="btn" onclick="Go('?action={$action}');"/>
</div>
</form>
<div class="bd">
<table cellpadding="1" cellspacing="0" class="tb">
<tr>
<th>Serial number</th>
<th>Income</th>
<th>Expenditure</th>
<th>Balance</th>
<th width="130">Time of occurrence</th>
<th width="150">Subject</th>
<th width="150">Remark</th>
</tr>
{loop $records $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td height="30" class="px11">{$v[itemid]}</td>
<td class="px11 f_blue">{if $v[amount] > 0}{$v[amount]}{else}&nbsp;{/if}</td>
<td class="px11 f_red">{if $v[amount] < 0}{$v[amount]}{else}&nbsp;{/if}</td>
<td class="px11">{if $v[balance]}{$v[balance]}{else}&nbsp;{/if}</td>
<td class="px11 f_gray">{$v[addtime]}</td>
<td title="{$v[reason]}"><input type="text" size="20" value="{$v[reason]}"/></td>
<td title="{$v[note]}"><input type="text" size="20" value="{$v[note]}"/></td>
</tr>
{/loop}
<tr align="center">
<td height="35"><strong>小计</strong></td>
<td class="px11 f_blue">{$income}</td>
<td class="px11 f_red">{$expense}</td>
<td colspan="4">&nbsp;</td>
</tr>
</table>
<div class="pages">{$pages}</div>
<script type="text/javascript">s('credit');m('action');</script>
{/if}
{template 'footer', $module}